<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddGiveTeamLevelsToConfigSalesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('config_sales', function (Blueprint $table) {
            $table->integer('give_team_levels')->default(6)->comment('发放佣金层级');
            $table->decimal('order_commander_rewards_percent', 10, 2)->default(50.00)->comment("普通团长返佣比例");
            $table->decimal('order_senior_commander_rewards_percent', 10, 2)->default(100.00)->comment("高级团长返佣比例");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('config_sales', function (Blueprint $table) {
             $table->dropColumn(['give_team_levels','order_commander_rewards_percent','order_senior_commander_rewards_percent']);
        });
    }
}
